home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 113_01 / a68.doc < prev    next >
Text File  |  1985-03-09  |  36KB  |  1,315 lines

  1. /*
  2.     HEADER:        CUG113;
  3.     TITLE:        6800 Cross-Assembler (BDS C Version);
  4.     FILENAME:    A68.DOC;
  5.     VERSION:    2.6;
  6.     DATE:        07/22/1985;
  7.  
  8.     DESCRIPTION:    "This program lets you use your CP/M-80-based computer
  9.             to assemble code for the Motorola 6800, 6801, 6802,
  10.             6803, 6808, and 68701 microprocessors.  The program is
  11.             written in BDS C for the best possible performance on
  12.             8-bit machines.  All assembler features are supported
  13.             except relocation, linkage, listing control, and
  14.             macros.";
  15.  
  16.     KEYWORDS:    Software Development, Assemblers, Cross-Assemblers,
  17.             Motorola, MC6800, MC6801;
  18.  
  19.     SEE-ALSO:    CUG149, 6801 Cross-Assembler (Portable);
  20.  
  21.     SYSTEM:        CP/M-80;
  22.     COMPILERS:    BDS C;
  23.  
  24.     WARNINGS:    "This package is specifically tailored to CP/M-80
  25.             machines and the rather non-standard, but high-
  26.             performance BDS C compiler.  For other environments,
  27.             use the portable version of this package on CUG149.";
  28.  
  29.     AUTHORS:    William C. Colley III;
  30. */
  31.         6800 Cross-assembler  Rev. 2.6                          Page 1
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                               6800 Cross-assembler
  48.  
  49.  
  50.                                     Rev. 2.6
  51.  
  52.  
  53.                Copyright (c) 1980,83,84,85 William C. Colley, III
  54.  
  55.  
  56.  
  57.                            The Manual Such As It Is.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.         6800 Cross-assembler  Rev. 2.6                          Page 2
  93.  
  94.  
  95.         Index
  96.  
  97.  
  98.         1    Format of Cross-assembler Commands....................... 3
  99.  
  100.              1.1  Command Strings..................................... 3
  101.              1.2  Options............................................. 3
  102.              1.3  Examples............................................ 3
  103.  
  104.         2    Format of Cross-assembler Source Files................... 5
  105.  
  106.              2.1   Statements......................................... 5
  107.              2.2   Symbols............................................ 5
  108.              2.3   Numeric Constants.................................. 6
  109.              2.4   Strings............................................ 6
  110.  
  111.         3    Expression Evaluation.................................... 8
  112.  
  113.         4    6800/6801 Instructions................................... 9
  114.  
  115.              4.1  No Argument Group................................... 9
  116.              4.2  One Argument Group.................................. 9
  117.              4.3  Two Argument Group..................................10
  118.              4.4  Branch Group........................................10
  119.              4.5  Jump Group..........................................11
  120.              4.6  Stack Group.........................................11
  121.              4.7  Pointer Group.......................................11
  122.              4.8  On Direct-page Addressing...........................11
  123.  
  124.         5    Pseudo-operations........................................13
  125.  
  126.              5.1  END.................................................13
  127.              5.2  EQU.................................................13
  128.              5.3  FCB.................................................13
  129.              5.4  FCC.................................................13
  130.              5.5  FDB.................................................13
  131.              5.6  RMB.................................................14
  132.              5.7  Conditional Assembly................................14
  133.              5.8  ORG.................................................15
  134.              5.9  SET.................................................15
  135.              5.10 CPU.................................................15
  136.  
  137.         6    Error Messages...........................................16
  138.  
  139.         7    Assembler Abort Conditions...............................18
  140.  
  141.         8    Compiling the Assembler..................................19
  142.  
  143.         9    Final Comments...........................................21
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.         6800 Cross-assembler  Rev. 2.6                          Page 3
  154.  
  155.  
  156.         1    Format of Cross-assembler Commands
  157.  
  158.         1.1  Command Strings
  159.  
  160.              To run the cross-assembler, type the following command line:
  161.  
  162.                   A>a68 filename options
  163.  
  164.                   filename: The   name  of  the  source  input  file   is 
  165.                             filename.68h,    the    list   can   go    to 
  166.                             filename.prn,  and  the  hex file can  go  to 
  167.                             filename.hex.
  168.  
  169.                   options:  See next section.
  170.  
  171.         1.2  Options
  172.  
  173.              The  source file comes from the currently logged disk  drive 
  174.              unless  it  is redirected by putting the string "sd" in  the 
  175.              options  field.   s  specifies the source file and  d  is  a 
  176.              device code from the following list:
  177.  
  178.                   a, b, c, d     Disk drives.
  179.                   -              The currently logged in disk drive.
  180.  
  181.              Lines  of  input containing errors will always be output  to 
  182.              the console device.  If the full listing is desired, it must 
  183.              be  called  for by putting the string "ld"  in  the  options 
  184.              field.   l specifies list file and d is a device code as per 
  185.              the source file, or one of the following:
  186.  
  187.                   x              Console device.
  188.                   y              List device.
  189.  
  190.              The hex file will not be output unless called for as per the 
  191.              list file.
  192.  
  193.              Options  must  be run together into a single string with  no 
  194.              embedded blanks.
  195.  
  196.         1.3  Examples
  197.  
  198.                   A>a68 barf          source -- a:barf.68h
  199.                                       list   -- none.
  200.                                       hex    -- none.
  201.  
  202.                   A>a68 barf sblxha   source -- b:barf.68h
  203.                                       list   -- con:
  204.                                       hex    -- a:barf.hex
  205.  
  206.                   A>a68 barf ly       source -- a:barf.68h
  207.                                       list   -- lst:
  208.                                       hex    -- none.
  209.  
  210.  
  211.  
  212.  
  213.  
  214.         6800 Cross-assembler  Rev. 2.6                          Page 4
  215.  
  216.  
  217.                   A>b:a68 barf sbh-   source -- b:barf.68h
  218.                                       list   -- none.
  219.                                       hex    -- a:barf.hex
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.         6800 Cross-assembler  Rev. 2.6                          Page 5
  276.  
  277.  
  278.         2    Format of Cross-assembler Source Files
  279.  
  280.              Lines  of  source  input are terminated  with  CR/LF  pairs.  
  281.              Internally,  the character before the LF is discarded, so if 
  282.              the  CR is missing,  the last character of the line will  be 
  283.              eaten up.   The internal line buffer will hold a 120 charac-
  284.              ter  line.   This  may be changed by altering  the  "#define 
  285.              LINLEN  120"  statement in a68.h and recompiling the  cross-
  286.              assembler.  Excess characters in the line are thrown out.
  287.  
  288.              Lower  case  letters are converted to upper case in  as  few 
  289.              places as possible.  They are:
  290.  
  291.                   1)   In opcodes,
  292.  
  293.                   2)   In checking for keywords such as NOT, and
  294.  
  295.                   3)   In command strings.
  296.  
  297.              This means that "not",  "NOT",  "Not", etc. are all possible 
  298.              spellings of the bitwise logical inversion  operator.   This 
  299.              also  means  that  "foo" and "FOO"  are  different  symbols.  
  300.              Watch  this  if you start encountering U errors  of  symbols 
  301.              that you "know" you defined.
  302.  
  303.         2.1  Statements
  304.  
  305.              Source files input to the Cross-assembler consist of  state-
  306.              ments of the form:
  307.  
  308.                   [label] [opcode] [arguments] [;comments.]
  309.  
  310.              Labels are recognized by their beginning in column 1.  If